//
//  MsgUserBigEmojiCell.swift
//  swiftim
//
//  Created by yangjian on 2023/6/13.
//

import Foundation


class MsgUserBigEmojiCell : MsgUserBaseCell {
    
    let gifView = UIImageView()
    
    
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.configMsgSubViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func configMsgSubViews() {
        configBubbleView(superView: msgBackgroundView, aboveView: msgContentView)

        msgContentView.addSubview(gifView)
        
        stateLabel.snp.makeConstraints { make in
            make.bottom.equalTo(self.msgContentView.snp.bottom)
            make.right.equalTo(self.msgContentView.snp.left).offset(-20)
        }
        
        gifView.snp.makeConstraints { make in
            make.top.equalTo(msgBackgroundView)
            make.bottom.equalTo(msgBackgroundView)
            make.left.equalTo(msgBackgroundView)
            make.right.equalTo(msgBackgroundView)
            make.size.equalTo(MsgCellOtherLayoutAdapterConfig.share.bigEmojiContentSize)
        }
        
    }
    
    override func resetSubViewsLayout(showName: Bool, showHead: Bool) {
        super.resetSubViewsLayout(showName: showName, showHead: showHead)
        resetBubbleleView(aboveView: msgContentView)

    }
    
    
    override func bindFromModel(_ model: MsgCellBaseModel) {
        super.bindFromModel(model)
        let body = model.message.body as! EMTextMessageBody
        gifView.setGifImage(data: JJEmojiUtil.emojiNameToData(name: "xxx.gif"))
    }
    
    
    
    
    
    
    
    
    
    
}
